{include 'public/header.html'}

<div class="main-content">

<div class="page-content">

  <div class="page-content-area" style="opacity: 0.8;"> <br>

    <div class="page-header">

      <h1> 考勤管理 <small><i class="ace-icon fa fa-angle-double-right"></i> 考勤列表 </small> </h1>

    </div>

    <div class="row">

      <div class="col-xs-12">

        <div class="panel panel-info">

          <div class="panel-heading" onclick="$(this).parent().find('.panel-body').toggle()">筛选</div>

          <div class="panel-body">

            <div class="form-group form-search form-inline">

              <label class="control-label">关键词</label>

              <input id="keywords" name="keywords" value="{$smarty.get.keywords}" type="text"/>

              <button class="btn btn-default btn-sm btn-search"><i class="fa fa-search"></i> 搜索</button>

            </div>

          </div>

        </div>

        <form method="post" class="form-horizontal" role="form" id="submitform" onsubmit="return false">

          <table class="table table-bordered table-hover">

            <thead>

              <tr>

                <th>ID</th>

                <th>姓名</th>

                <th>设备</th>

                <th>卡号</th>

                <th>图片</th>

                <th>图片2</th>

                <th>时间</th>

              </tr>

            </thead>

            <tbody>

            

            {foreach $list.data as $v}

            <tr>

              <td><input type="checkbox" name="id[]" value="{$v['id']}"/>

                {$v['id']}</td>

              <td>{$v['name']}</td>

              <td>{$v['device_id']}</td>

              <td>{$v['iccode']}</td>

              <td><a href="{siteurl()}{$v['pic']}" target="_blank"><img width="50" height="50" src="{siteurl()}{$v['pic']}" /></a></td>
              
              <td><a href="{siteurl()}{$v['pic_second']}" target="_blank"><img width="50" height="50" src="{siteurl()}{$v['pic_second']}" /></a></td>

              <td>{formattime($v['add_time'])}</td>

            </tr>

            {/foreach}

            <tr>

              <td colspan="7"><input type="checkbox" onclick="var ck = this.checked;$('input[name=&quot;id[]&quot;]').each(function(){ this.checked = ck });">

                <a class="btn btn-default btn-delete">删除</a></td>

            </tr>

              </tbody>

            

          </table>

          <table style="width:100%;" class="listpage">

            <tr>

              <td>{showpage($list.page)}</td>

            </tr>

          </table>

        </form>

      </div>

    </div>

  </div>

</div>

<script>

$(function(){

	$('.btn-delete').click(function(){

		var ckvals = $.selectCK('input[name="id[]"]');

		if(!ckvals){

			tooltipbox.show('请选择要操作的数据');

			return false;

		}

		tooltipbox.confirm('确定永久删除选中的数据？', function(data){

			tooltipbox.show('正在执行操作...');

			$.post('{siteurl("con=admin/shuttle/delete")}', data, function(res){

				if(res.code == 1){

					location.reload();

				}

				tooltipbox.show(res.msg);

			}, 'json').error(function(){

				tooltipbox.show('数据或网络错误');

			});

		}, false, { 'ids': ckvals });

	});

});

</script> 

{include 'public/footer.html'} 